#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
using namespace std;

const int N = 1e5 + 10;
int n;
long long arr[N * 3];

int main() {
    cin >> n;
    for (int i = 0;i < 3 * n;i++)
        cin >> arr[i];
    sort(arr, arr + 3 * n);

    long long ret = 0;
    long long pos = 3 * n - 2, count = 1;
    while (count++ <= n)
    {
        ret += arr[pos];
        pos -= 2;
    }

    cout << ret << endl;

    return 0;
}